package com.mingqi.enetconnected.primary.personcentre;

import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.TextView;

import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.base.BaseActivity;
import com.mingqi.enetconnected.util.resource.ResourceUtils;
import com.mingqi.enetconnected.view.FluidLayout;

import butterknife.BindView;

public class PersonInfoActivity extends BaseActivity {

    @BindView(R.id.fl_ability)
    FluidLayout mFlAbility;

    private String[] tags = new String[]{
            "居民点火","房内管安装","房内管安装11","房内管安装1111","房内管安装11111"};

    @Override
    protected int getLayoutID() {
        return R.layout.activity_person_info;
    }

    @Override
    protected void initView() {

        setTitleName(ResourceUtils.getString(R.string.person_info));
    }

    @Override
    protected void initData() {

        showAbility();
    }

    private void showAbility() {

        mFlAbility.setGravity(Gravity.CENTER);

        for (int i = 0; i < tags.length; i++) {

            TextView tv = new TextView(this);
            tv.setText(tags[i]);
            tv.setTextSize(15);
            tv.setTextColor(ResourceUtils.getColor(R.color.tv_content));

            FluidLayout.LayoutParams params = new FluidLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT
            );

            params.setMargins(ResourceUtils.getDimen(R.dimen.x15), ResourceUtils.getDimen(R.dimen.y5), 0, 0);

            mFlAbility.addView(tv, params);
        }
    }
}
